Facial expression synthesis method and apparatus, electronic device, and storage medium

ABSTRACT

A facial expression synthesis method is provided. The method includes obtaining a to-be-processed facial image of a target object, and processing the to-be-processed facial image by using a face-recognition operation, to obtain skin color information of the to-be-processed facial image; screening out a target expression-material image, from a plurality of expression-material images in an expression-material image library, matching the skin color information; extracting a region image corresponding to a target synthesis region in the target expression-material image; and performing Poisson fusion processing on the region image and the to-be-processed facial image to fuse the region image with the to-be-processed facial image, so as to obtain a target facial image of the target object.

RELATED APPLICATIONS

This application is a continuation application of PCT Patent ApplicationNo. PCT/CN2018/097180, filed on Jul. 26, 2018, which claims priority toChinese Patent Application No. 201710640537.8, entitled “FACIALEXPRESSION SYNTHESIS METHOD AND APPARATUS, AND ELECTRONIC DEVICE” andfiled with the China National Intellectual Property Administration onJul. 31, 2017, content of all of which is incorporated by reference inits entirety.

FIELD OF THE TECHNOLOGY

This application relates to the field of data processing technologiesand, in particular, to a facial expression synthesis method andapparatus, an electronic device, and a storage medium.

BACKGROUND

Facial expressions are changes of eye muscles, facial muscles, and mouthmuscles for showing various emotional states, such as happiness,surprise, sadness, fear, shyness, and anger. As a subtle body language,facial expressions are an important means of conveying emotionalinformation, and the inner world of users can be effectively understoodby performing expression analysis on face images, thereby making theface-to-face communication more vivid.

In recent years, the facial expression synthesis has attracted muchattention in applications such as character animation, human-computerinteraction, and teleconference. People may replace a facial state witha plurality of states according to a personal interest or an actualdemand for diversified presentations, thereby improving the massentertainment and interest.

In the related art, various ways based on a color histogram, a skincolor fusion algorithm, and direct paste are usually used to replacefacial expressions. For example, an angry mouth of user A is replacedwith a smiling mouth of user B, and smiling single-fold eyes of user Care replaced with angry double-fold eyes of user D. However, the changesof facial expressions not only include the movement deformation (such asthe opening and closing of the mouth and eyes) of the entire facialfeature, but also include subtle changes of the local appearance. Theexisting facial expression synthesis method achieves a barelysatisfactory synthesis effect, and usually has problems such as unevenskin color fusion, incorrect facial organ positioning, and abrupt edgesand corners, causing relatively low synthesis efficiency of facialexpressions.

The disclosed methods and systems are directed to solve one or moreproblems set forth above and other problems.

SUMMARY

In view of this, embodiments of the present disclosure provide a facialexpression synthesis method and apparatus, an electronic device, and astorage medium, to resolve the technical problems such as uneven skincolor fusion, incorrect facial organ positioning, and abrupt edges andcorners in synthesized images obtained by using the existing facialexpression synthesis method.

One aspect of the present disclosure includes a facial expressionsynthesis method. The method includes obtaining a to-be-processed facialimage of a target object, and processing the to-be-processed facialimage by using a face-recognition operation, to obtain skin colorinformation of the to-be-processed facial image; screening out a targetexpression-material image, from a plurality of expression-materialimages in an expression-material image library, matching the skin colorinformation; extracting a region image corresponding to a targetsynthesis region in the target expression-material image; and performingPoisson fusion processing on the region image and the to-be-processedfacial image to fuse the region image with the to-be-processed facialimage, so as to obtain a target facial image of the target object.

Another aspect of the present disclosure includes an electronic device.The electronic device includes a communications interface; a memory forstoring a plurality of instructions; and a processor. The processor isconfigured to load and execute the plurality of instructions to perform:obtaining a to-be-processed facial image of a target object, andprocessing the to-be-processed facial image by using a face-recognitionoperation, to obtain skin color information of the to-be-processedfacial image; screening out a target expression-material image, from aplurality of expression-material images in an expression-material imagelibrary, matching the skin color information; extracting a region imagecorresponding to a target synthesis region in the targetexpression-material image; and performing Poisson fusion processing onthe region image and the to-be-processed facial image to fuse the regionimage with the to-be-processed facial image, so as to obtain a targetfacial image of the target object.

Another aspect of the present disclosure includes a non-transitorycomputer-readable storage medium. The non-transitory computer-readablestorage medium stores computer program instructions executable by atleast one processor to perform: obtaining a to-be-processed facial imageof a target object, and processing the to-be-processed facial image byusing a face-recognition operation, to obtain skin color information ofthe to-be-processed facial image; screening out a targetexpression-material image, from a plurality of expression-materialimages in an expression-material image library, matching the skin colorinformation; extracting a region image corresponding to a targetsynthesis region in the target expression-material image; and performingPoisson fusion processing on the region image and the to-be-processedfacial image to fuse the region image with the to-be-processed facialimage, so as to obtain a target facial image of the target object.

Other aspects of the present disclosure can be understood by thoseskilled in the art in light of the description, the claims, and thedrawings of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions in the embodiments of the presentdisclosure or the related art more clearly, the following brieflydescribes the accompanying drawings. Apparently, the accompanyingdrawings in the following descriptions show merely some, but not all,embodiments of the present disclosure, and a person of ordinary skill inthe art may still derive other drawings from these accompanying drawingswithout creative efforts.

FIG. 1 is a diagram of a hardware structure of an electronic deviceaccording to an embodiment of the present disclosure;

FIG. 2 is a schematic flowchart of a facial expression synthesis methodaccording to an embodiment of the present disclosure;

FIG. 3 is a schematic diagram of facial feature points extracted in afacial image according to an embodiment of the present disclosure;

FIG. 4A is a schematic diagram of a to-be-processed facial image of atarget object according to an embodiment of the present disclosure;

FIG. 4B is a schematic diagram of a target expression-material imageaccording to an embodiment of the present disclosure;

FIG. 4C is a target synthesis region obtained for the targetexpression-material image of FIG. 4B according to an embodiment of thepresent disclosure;

FIG. 4D is a region image corresponding to the target synthesis regionshown in FIG. 4C in the target expression-material image of FIG. 4Baccording to an embodiment of the present disclosure;

FIG. 4E and FIG. 4F are respectively schematic diagrams of a targetfacial image according to an embodiment of the present disclosure;

FIG. 5 is a schematic diagram of image synthesis according to anembodiment of the present disclosure;

FIG. 6 is a signaling diagram of a facial expression synthesis methodaccording to an embodiment of the present disclosure;

FIG. 7 is a to-be-processed facial expression selection interfaceaccording to an embodiment of the present disclosure;

FIG. 8 is a schematic flowchart of another facial expression synthesismethod according to an embodiment of the present disclosure;

FIG. 9A and FIG. 9D are respectively to-be-processed facial images of atarget object according to an embodiment of the present disclosure;

FIG. 9B is a target expression-material image screened out for theto-be-processed facial image of FIG. 9A;

FIG. 9C is a synthesized image obtained by synthesizing the region imageshown in FIG. 9B into the to-be-processed facial image of FIG. 9A;

FIG. 9E is a target expression-material image screened out for theto-be-processed facial image of FIG. 9D;

FIG. 9F is a synthesized image obtained by synthesizing the region imageshown in FIG. 9E into the to-be-processed facial image of FIG. 9D;

FIG. 10 is a structural block diagram of a facial expression synthesisapparatus according to an embodiment of the present disclosure;

FIG. 11 is a structural block diagram of another facial expressionsynthesis apparatus according to an embodiment of the presentdisclosure;

FIG. 12 is a structural block diagram of still another facial expressionsynthesis apparatus according to an embodiment of the presentdisclosure; and

FIG. 13 is a structural block diagram of yet another facial expressionsynthesis apparatus according to an embodiment of the presentdisclosure.

DESCRIPTION OF EMBODIMENTS

The following describes the technical solutions in the embodiments ofthe present disclosure with reference to the accompanying drawings.Apparently, the described embodiments are some of the embodiments of thepresent disclosure rather than all of the embodiments. All otherembodiments obtained by a person of ordinary skill in the art based onthe embodiments of the present disclosure without creative efforts shallfall within the protection scope of the present disclosure.

A facial expression synthesis method provided in the embodiments of thepresent disclosure may be applied to an electronic device having a dataprocessing capability. The electronic device may be a server disposed ata network side or may be a terminal device such as a personal computer(PC) disposed at a user side. A computing device may be loaded with aprogram with a function corresponding to the facial expression synthesismethod provided in the embodiments of the present disclosure, toimplement the facial expression synthesis method provided in theembodiments of the present disclosure. The program may be stored in amemory of the computing device, and invoked by a processor to implementthe program function.

FIG. 1 shows a block diagram of a hardware structure of an electronicdevice according to an embodiment of the present disclosure. Referringto FIG. 1, the electronic device may include: a communications interface11, a memory 12, a processor 13, and a communications bus 14.

In one embodiment of the present disclosure, quantities of thecommunications interfaces 11, the memories 12, the processors 13, andthe communications buses 14 may all be at least one, and thecommunications interface 11, the memory 12, and the processor 13 maycomplete mutual communication through the communications bus 14.

Optionally, the communications interface 11 may be an interface of acommunications module, such as an interface of a GSM module, used forimplementing data interaction with other devices, such as receiving arequired target expression-material image fed back by anexpression-material library.

The processor 13 may be a central processing unit (CPU) or anapplication specific integrated circuit (ASIC), or may be one or moreintegrated circuits configured to implement the facial expressionsynthesis method provided in the embodiments of the present disclosure.

The memory 12 may include a high-speed RAM memory or may include anon-volatile memory, for example, at least one magnetic disk memory.

In the present disclosure, the memory 12 may store a program including aplurality of instructions used for implementing the facial expressionsynthesis method provided in the embodiments of the present disclosure,and the processor 13 invokes and loads the program stored in the memory13, thereby implementing the facial expression synthesis method providedin the embodiments of the present disclosure. For the implementationprocess, reference may be made to the description of the followingcorresponding embodiments.

The hardware structure of the electronic device shown in FIG. 1 ismerely optional. According to use needs, the computing device may befurther provided with a display screen, an information input apparatus(such as a keyboard or a mouse), a graphics processing unit, an imageacquisition device, and the like, which are not described in detailherein in the present disclosure.

The following describes the facial expression synthesis method providedin the embodiments of the present disclosure from the perspective of theelectronic device. The following described method steps may beimplemented by the electronic device to execute a corresponding program.

FIG. 2 is a flowchart of a facial expression synthesis method accordingto an embodiment of the present disclosure. The method may be applied toan electronic device. Referring to FIG. 2, the method may include thefollowings

S201. Obtain a to-be-processed facial image of a target object.

In the present disclosure, the facial image may be a two-dimensional(2D) image, and may be an image that includes a target object and thatis acquired by a terminal device through a camera, or an image thatincludes a target object and that is retrieved from a local imagelibrary, or an image sent by another device. The present disclosure doesnot limit the manner for obtaining the facial image of the targetobject.

Optionally, if the electronic device that implements the facialexpression synthesis method provided in one embodiment is a terminaldevice, in actual application, the terminal device may directly acquirean image through a camera, process the acquired image by using a facedetection algorithm, and determine whether a facial image of a targetobject exists in the image. If no facial image exists, the terminaldevice continues to perform face detection on a next frame of image,until the facial image of the target object is obtained; and if thefacial image exists, the terminal device may extract a facial regionpart of the target object, to obtain the to-be-processed facial image.

Certainly, the terminal device may further directly display a pluralityof facial images stored in a local image library, for a user to selectone as the to-be-processed facial image of the target object accordingto requirements. In addition, the terminal device may further obtain theto-be-processed facial image of the target object through other manners,such as downloading from webpages through the Internet, which are notlisted herein in the present disclosure.

As another embodiment of the present disclosure, if the electronicdevice that implements the facial expression synthesis method providedin one embodiment is a server, after determining the to-be-processedfacial image of the target object by using the terminal device, the usermay directly upload the to-be-processed facial image to the server forsubsequent processing.

S202. Process the to-be-processed facial image by using aface-recognition operation, to obtain skin color information of theto-be-processed facial image.

Optionally, after the to-be-processed facial image of the target objectis obtained, in the present disclosure, the to-be-processed facial imagemay be processed by using a facial feature point positioning algorithm,to automatically position a plurality of key facial feature points, suchas eyes, the tip of the nose, mouth corner points, eyebrows, and contourpoints of facial parts, such as the black points shown in FIG. 3. As canbe seen, first facial feature points may be a plurality of key facialfeature points of the to-be-processed facial image.

The facial feature point positioning algorithm may further include anactive shape model (ASM) algorithm, an active appearance model (AAM)algorithm, and the like, and is mainly implemented by using a positionconstraint combination between a face texture feature and each featurepoint. The implementation method for recognizing the facial featurepoints is not described in detail in the present disclosure.

Optionally, the determined key facial feature points may be labeledaccording to requirements, to determine the shape of the region in whichthe foregoing components are located. The present disclosure does notlimit the method for labeling the key facial feature points.

After a target synthesis region with skin color information to bedetected and/or an entire facial region is determined, facial featurepoints in the corresponding region may be used to form a correspondingpolygonal shape. Endpoints of the polygonal shape may be first facialfeature points in the corresponding region, and edges usually do notinclude the first facial feature points in the corresponding region,such as the polygonal shape formed by connecting key feature points atthe edge of the mouth in FIG. 3, but is not limited thereto.

Then, in the present disclosure, the images in the formed polygonalshape may be detected by using a skin color detection algorithm, toobtain corresponding skin color information, as a condition of screeningout a target expression-material image subsequently.

In the present disclosure, according to different screening conditions,regions (namely, regions encircled by polygonal shapes) with the skincolor information to be detected are different. For example, skin colordetection is performed on the entire facial region of theto-be-processed facial image, and/or skin color detection is performedon the target synthesis region such as the mouth region, or skin colordetection is performed on other regions in the to-be-processed facialimage.

For detection regions with different skin color information, theclassified storage manners for the expression-material images in theexpression-material image library are different. For the implementationprocess, reference may be made to the description in the followingcorresponding embodiments. Details are not described herein again in oneembodiment.

S203. Screen out a target expression-material image that is in anexpression-material image library and that matches the skin colorinformation.

An expression-material image may refer to any image containing a region(e.g., a part of the image) reflecting an expression that may be usedfor synthesis. A target expression-material image may refer to oneexpression-material image selected for the synthesis. Anexpression-material image library may include a plurality ofexpression-material images to be searched to select the targetexpression-material image.

In operation, because skin colors of different users have somedifferences, if the same expression-material is used, skin colorrequirements of users usually cannot be met. Thus, when theto-be-processed facial image and the expression-material image arefused, their skin colors differ greatly, making the obtained synthesizedimage very unnatural. Based on this, in the present disclosure, whenmaterials used for synthesizing to-be-processed facial expressions ofthe target object are screened out, the difference of their skin colorsis considered.

Optionally, classified storage may be performed on the plurality ofexpression-material images included in the expression-material imagelibrary according to the corresponding skin color information. Moreover,because the detected skin color information is usually different when alight condition of the same expression-material image is different, forthe same expression-material image, classified storage of the skin colorinformation may be further implemented in combination with the lightcondition. The present disclosure does not limit the storage manner. Forexample, manners such as table correspondence tables and mappingfunctions are not described in detail herein in the present disclosure.

The classification of the plurality of expression-material imagesaccording to the skin color information may be implemented according toa plurality of pieces of skin color information such as the skin colorinformation of the entire face of each expression-material image, theskin color information of the target synthesis region, and/or the skincolor information of other regions, thereby improving the classificationprecision of the expression-material images. Based on this, thescreening of the target expression-material image may be implementedaccording to the plurality of pieces of skin color information, therebygreatly improving the skin color matching degree between the imageobtained through screening and the to-be-processed facial image, andensuring the finally obtained target facial image to be natural.

Optionally, in the present disclosure, the facial image regions of theexpression-material images, the component regions, and the correspondingskin color information may be obtained by using a face recognitionalgorithm. The implementation method is not described in detail.

S204. Extract a region image corresponding to a target synthesis regionin the target expression-material image.

Optionally, similar to the foregoing manner for obtaining the targetsynthesis region of the to-be-processed facial image, in the presentdisclosure, facial feature points of the target expression-materialimage may also be recognized to form a polygonal shape by using theplurality of obtained facial feature points, thereby obtaining theregion image corresponding to the target synthesis region.

For example, assuming that the facial image of the target object isshown in FIG. 4A and the obtained target expression-material image isshown in FIG. 4B, and assuming that when the mouth region in theto-be-processed facial image of the target object needs to be replaced,that is, the mouth region in the target expression-material image needsto be synthesized into the to-be-processed facial image, the polygonalshape shown in FIG. 4C may be formed by connecting the key featurepoints of the mouth region in the target expression-material image,thereby obtaining the region image that is shown in FIG. 4D and thatcorresponds to the polygonal shape.

The manner for extracting the region image of the target synthesisregion in the target expression-material image is not limited to themanner described above.

S205. Perform Poisson fusion processing on the region image and theto-be-processed facial image, to obtain a target facial image of thetarget object.

In operation, common image filtering and de-noising algorithms may beclassified into two categories: one category is performing globalprocessing on an image, and the other category is using a localoperator. The main idea of the global processing is first performingmathematical transformation on the image, then performing filtering in atransform domain, and finally performing inverse transformation toobtain a de-noised image. The main idea of the method of using a localoperator is processing a pixel of a noisy image, and only using a localoperator on the pixel, which is applicable to a situation in which anoise model cannot be estimated or is hard to be estimated. Thealgorithms usually include a conventional domain average method, amedian filtering algorithm, a template smoothing algorithm, and thelike. However, these methods may blur the edges and details of the imagewhile effectively filtering the noise in the image, which affects theprocessing effect of the image to some extent, and does not conform tothe original intention of maintaining detail information as much aspossible and making the synthesized image more real and natural.

Therefore, in the present disclosure, spatial position information offactors such as light in a detail indicating image is considered, andfiltering processing is performed on the obtained region image by usinga Poisson algorithm. Then, the filtered image is synthesized into theto-be-processed facial image by using a Poisson fusion method, to obtainthe target facial image. For the process of processing the region imageand the to-be-processed facial image by using the Poisson algorithm,reference may be made to the description of the following embodiments.Details are not described herein in one embodiment. However, theprocessing method for implementing fusion of the region image and theto-be-processed facial image by using the Poisson algorithm is notlimited to the method described in the following embodiments of thepresent disclosure. The present disclosure provides description by usingonly this example herein.

Accordingly, in the present disclosure, during selecting of the targetexpression-material, the skin color difference between theto-be-processed facial image and the expression-material image isconsidered, so that the skin colors of the selected targetexpression-material image and the to-be-processed face are very close oreven the same, thereby ensuring that when the extracted region image issynthesized into the to-be-processed facial image, seamless fusion canbe implemented, and the entire skin color of the obtained synthesizedimage is natural and smooth.

Moreover, in the image fusion process, in the present disclosure, thePoisson fusion manner is used to perform filtering processing on theobtained region image, so that the processed expression details are morerobust, thereby reducing the ghosting of the mouth region in thesynthesis result, and effectively maintaining the light and skin colorinformation of the face of the target object.

Optionally, to describe the foregoing image fusion processing processmore clearly, the present disclosure provides description with referenceto the schematic diagram shown in FIG. 5. ImageA in FIG. 5 is ato-be-processed facial image of an inputted target object, and ImageB isa region image of an obtained target expression-material.

In the image fusion process, it is expected that color change can beperformed on ImageB according to ImageA, and feature details of theimage, such as edges, corners, and transition, can be remained in amanner. In operation, the Poisson algorithm is usually allowed to adjustabsolute information (such as a color) of ImageB, but after ImageB ispasted on ImageA, relative information (such as an image gradient) ofImageB may be remained as much as possible. To implement the technicaleffect, the boundary constraint of the target facial image may beimplemented according to the following formula (1), but is not limitedthereto.

H _((x,y)) =A _((x,y))∀(x,y)∈∂B   (1)

In the formula (1), A represents the to-be-processed facial image ImageAof the foregoing inputted target object, B represents the region imageImageB of the target expression-material, H represents the synthesizedtarget facial image, V (x,y) represents all pixels of H, and ∂Brepresents the boundary of the region image ImageB.

In the present disclosure, the pixel on the boundary of the targetfacial image H obtained after the image fusion processing is usuallytotally the same as the pixel in A on the boundary, so that B can matchpixels outside the boundary, and the pixel of A on the boundary of B aremixed inward.

To ensure the synthesis quality of the synthesized target facial image,and make the synthesis region of the synthesized target facial image notabrupt, it is usually required that the gradient of pixels inside H isequal to the gradient of pixels inside B. Therefore, in the presentdisclosure, the following definition may be made: the gradient spots∇B_((x,y)) of the image are the sum of the differences between the pixelB(x,y) and its all neighboring pixels (such as four pixel pointsneighboring to the pixel B(x,y): B(x−1,y), B(x+1,y), B(x,y−1), andB(x,y+1)), namely, the following formula (2). The pixel gradientcalculated through this manner is not limited to the pixel gradientcalculation method.

|∇B _((x,y))|=4B _((x,y)) −B _((x−1,y)) −B _((x+1,y)) −B _((x,y−1)) −B_((x,y+1))   (2)

In the formula (2), B(x,y) represents the pixel in ImageB, and Vrepresents the gradient symbol of the image pixel.

Optionally, in the pixel gradient calculation process, if a neighboringpixel of a pixel is a boundary pixel of the image, the pixel in B may becalculated in the manner shown in the formula (3), and the obtainedresult is usually a fixed value. If the neighboring pixel is justlocated outside the boundary of the selected pixel, the neighboringpixel may be excluded.

$\begin{matrix}{{{{N}{H( {x,y} )}} - {\sum\limits_{{{({{dx},{dy}})} + {({x,y})}} \in \Omega}\; {H( {{x + {dx}},{y + {dy}}} )}} - {\sum\limits_{{{({{dx},{dy}})} + {({x,y})}} \in {\partial\Omega}}{A( {{x + {dx}},{y + {dy}}} )}}} = {\sum\limits_{{{({{dx},{dy}})} + {({x,y})}} \in {({\Omega\bigcup{\partial\Omega}})}}( {{B( {{x + {dx}},{y + {dy}}} )} - {B( {x,y} )}} )}} & (3)\end{matrix}$

where (x,y) is a pixel position of interest in a 2D network, N is aquantity of effective neighboring pixels actually of the pixel in H in aselected region including a boundary (a quantity of image pixelsextending outward is less than or equal to 4), Ω is a selected region ofB and H without the boundary, and the local “Ω” is the boundary of theselected region, and (dx,dy) belongs to a subset of{(−1,0),(1,0),(0,−1),(0,1)}. Optionally, the foregoing formula (3) maybe resolved as follows:

The left side of the equation in the formula (3) is summing differencesbetween H(x,y) and its all N neighboring pixels, to calculate the spacegradient of the unknown point H(x,y); and the first sum at the left sideof the equation represents the difference between H(x,y) and anotherpixel point (x′,y′) on the selected region Ω, (x′, y′) is the positionof the neighboring pixel in H(x,y), and the second sum represents thedifference between H(x,y) and the boundary pixel points. The right sideof the equation is only the gradient of ImageB at (x,y), and hoped tomatch the gradient of new ImageH at H(x,y).

For a color image, equation set resolving may be respectively performedon pixels of three channels R, G, and B. For the resolving process ofthe channels, reference may be made to the calculation process in theforegoing description. Details are not described herein again in thepresent disclosure.

FIG. 6 is a signaling diagram of another facial expression synthesismethod according to an embodiment of the present disclosure. Oneembodiment is described from the perspective of composite hardware of anelectronic device, but is not limited to this implementation mannerdescribed in one embodiment. Referring to FIG. 6, the method may includethe followings.

S601. An image acquisition device acquires an image of a target object,to obtain a to-be-processed facial image.

In the present disclosure, the acquired image may be recognized by usinga face-recognition operation, to determine that the currently acquiredimage includes facial information of the target object, and the image isused as the to-be-processed facial image, or a facial image in the imageis extracted as the to-be-processed facial image, which is not limitedin the present disclosure.

S602. The image acquisition device sends the to-be-processed facialimage to a processor.

The manner for the processor to obtain the to-be-processed facial imageis not limited. As the foregoing description of the corresponding partof the embodiment corresponding to FIG. 2, a plurality of locally storedimages of the target object may be further obtained. As shown in FIG. 7,then, a user selects an image as the to-be-processed facial imageaccording to requirements, which is not described in detail herein inthe present disclosure.

S603. The processor recognizes first facial feature points of theto-be-processed facial image.

Referring to FIG. 3, in the present disclosure, the to-be-processedfacial image may be processed by using a facial feature pointpositioning algorithm, to automatically position a plurality of keyfacial feature points, namely, the first facial feature points.Moreover, the determined key facial feature points may be furtherlabeled according to requirements, to determine the shape of the regionin which the foregoing components are located. The present disclosuredoes not limit the method for labeling the key facial feature points.

S604. The processor determines a first region image of the targetsynthesis region in the to-be-processed facial image by using labelinformation of the first facial feature point.

Because the first facial feature points of the to-be-processed facialimage are located on eyebrows, eyes, nose, mouth, and contour line ofthe face, the shape of components (such as eyes, nose, mouth, eyebrows,and face) of the target object, such as the mouth region, the eyeregion, and the nose region, can be obtained according to the obtainedlabel information of the plurality of key facial feature points. In oneembodiment, replacement of the mouth region is described as an example.The manners for replacing other regions are similar to this, and are notdescribed herein again in the present disclosure.

The target synthesis region may be a mouth region in the to-be-processedfacial image, and the first region image is a mouth region image of theto-be-processed facial image. As shown in FIG. 3, key feature points ofthe mouth may be connected to determine the mouth region and the imagethereof, which is not limited thereto.

That is, a polygonal shape corresponding to the first facial featurepoints of the target synthesis region in the to-be-processed facialimage is obtained. Endpoints of the polygonal shape are the first facialfeature points of the target synthesis region, and the edges usually donot include the first facial feature points. Then, an imagecorresponding to the polygonal shape is extracted as a first region thatneeds to be replaced in the to-be-processed facial image.

S605. The processor performs skin color detection on the first regionimage and other region images in the to-be-processed facial image, todetermine first skin color information of the first region image andsecond skin color information of the other region images.

In the present disclosure, an OpenCV skin detection algorithm, a skinalgorithm based on different color space region divisions, and the likemay be used, to implement skin color detection on the first region imageand the other region images (especially the region image neighboring tothe target synthesis region) in the to-be-processed facial image. Theimplementation process of the image skin color detection is notdescribed in detail in the present disclosure, and the presentdisclosure also does not limit the content included in the obtainedfirst skin color information and second skin color information, such asthe pixel value of the corresponding part.

Further, the first skin color information refers to skin colorinformation of the region image that needs to be replaced in theto-be-processed facial image of the target object, namely, the skincolor information of the mouth region; and the second skin colorinformation may be skin color information of images of other regionsexcept the month of the target object.

As another embodiment of the present disclosure, in the presentdisclosure, skin color detection may also be performed only on thetarget synthesis region in the to-be-processed facial image by using theforegoing manner, to obtain the corresponding first skin colorinformation.

S606. The processor reads the expression-material image library, andscreens out a target expression-material image matching the first skincolor information and the second skin color information.

In one embodiment, when image screening is performed on theexpression-material image library, skin color information of the targetsynthesis region and skin color information of other regions areconsidered, thereby improving the precision of the targetexpression-material image, and further ensuring the entire skin color ofthe finally obtained synthesized image to be natural and smooth.

As another embodiment of the present disclosure, when images of otherparts of the face of the target object (namely, images of the regionexcept the target synthesis region) do not need to be changed, the skincolor difference state of other parts of the face may not be considered,and the skin color matching degree of the first target region isdirectly considered. That is, the target expression-material imagematching the first skin color information is directly screened out.

Based on the description of the foregoing different screening manners,in the present disclosure, the classified storage manners of theexpression-material images in the expression-material image library maybe different. If the target expression-material image needs to bescreened out by using the first skin color information and the secondskin color information, the classified storage may be performedaccording to standards of at least two aspects: the skin colorinformation of the target synthesis region and the skin colorinformation of other regions. If the first skin color information needsto be used to screen out the target expression-material image,classified storage may be performed according to the skin colorinformation of the target synthesis region in the expression-materialimages (namely, a region synthesized with the facial expression of theforegoing target object). The present disclosure does not limit theclassified storage manner of the expression-material images.

Optionally, in the present disclosure, storage of the facial imageregions of the expression-material images, the component regions and thecorresponding skin color information may be implemented in a tablemanner. In this way, after the screening condition (such as theforegoing first skin color information and second skin colorinformation, or only the second skin color information or the first skincolor information) for the table is determined, the screening conditionmay be compared with the skin color information of corresponding itemsin the table. For example, the first skin color information is comparedwith the skin color information of the region image that is in theexpression-material images and that corresponds to the first targetregion, and the second skin color information is compared with the skincolor information of the facial images of the expression-materialimages, thereby screening out the target expression-material imagematching the first skin color information and the second skin colorinformation.

As another embodiment of the present disclosure, before screening outthe expression-material image, in the present disclosure, a first rangeof a matching value (such as a similar value) of the skin colorinformation of the expression-material image and the first skin colorinformation and a second range of a matching value of the skin colorinformation of the expression-material image and the second skin colorinformation may be preset. In this way, during screening, whether anexpression-material image of which the skin color information is thesame as both the first skin color information and the second skin colorinformation exists in the expression-material images may be detected. Ifthe expression-material image exists, the expression-material image maybe directly used as the target material image. If theexpression-material image does not exist, an expression-material imagecorresponding to skin color information matching the first skin colorinformation most may be screened out from expression-material imageswhose matching degree with the second skin color information is withinthe second range as the target expression-material image; or anexpression-material image corresponding to skin color informationmatching the second skin color information most may be screened out fromthe expression-material images whose matching degree with the first skincolor information is within the first range as the targetexpression-material image, which may be determined according to usersettings, and is not limited in the present disclosure.

Optionally, when it is detected that no expression-material image ofwhich the skin color information is the same as both the first skincolor information and the second skin color information exists in theexpression-material images, an expression-material image whose matchingdegree with the first skin color information is within the first range,and a plurality of expression-material images whose matching degree withthe second skin color information is within the second range may befurther screened out, and the plurality of expression-material images isdisplayed, for the user to select one according to a personal interestas the target expression-material image.

Certainly, if only a target expression-material image matching the firstskin color information or the second skin color information needs to bescreened out, an example of screening the target expression-materialimage matching the first skin color information is used for description.Whether an expression-material image of which the skin color informationis the same as the first skin color information exists in theexpression-material images may be first detected. If theexpression-material image exists, the expression-material image may bedirectly used as a target material image. If the expression-materialimage does not exist, an expression-material image corresponding to skincolor information matching the first skin color information most may bescreened as the target expression-material image.

Optionally, the expression-material image library of the presentdisclosure may be located in the electronic device locally, or may belocated at a network side, for the electronic device to send the firstskin color information and the second skin color information to thenetwork side for screening. Then, the target expression-material imageobtained through screening is fed back to the electronic device. Theprocess is similar to that of one embodiment, and is not described byusing an example in the present disclosure.

S607. The processor recognizes second facial feature points of thetarget expression-material image, and determines a second region imageof the target synthesis region in the target expression-material imageby using the second facial feature points.

For the implementation methods for recognizing the second facial featurepoints of the target expression-material image, and determining thesecond region image, reference may be made to the foregoing descriptionof the implementation method for recognizing the first facial featurepoints of the to-be-processed facial image, and determining the firstregion image. Details are not described herein again.

In operation, after the second facial feature points (namely, the keyfeature points of the target expression-material, such as the blackpoints shown in FIG. 3) of the target expression-material image aredetermined, a second region image used for synthesizing with theto-be-processed facial image may be selected according to a presetrequirement. The preset requirement is determined based on the firstregion image that needs to be replaced in the to-be-processed facialimage, and may include information indicating the target synthesisregion, such as space coordinates of the target synthesis region. Thepresent disclosure does not limit the content included in the presetrequirement.

Referring to the foregoing FIG. 4A, FIG. 4B, FIG. 4C, and FIG. 4D, thetarget synthesis region is the mouth region in FIG. 4A. Therefore, afterthe target expression-material image shown in FIG. 4B is obtainedthrough screening in one embodiment, an image of the mouth region shownin FIG. 4D, namely, the second region image, may be obtained by usingthe polygonal shape formed by the key feature points. That is, thesecond region image corresponding to the polygonal shape formed by thesecond facial feature points of the target synthesis region in thetarget expression-material image is the region image that is in thetarget expression-material image and that is used for synthesizing ato-be-processed facial expression.

Optionally, to ensure that the obtained second region image matches theregion that needs to be replaced in the to-be-processed facial image,that is, the obtained mouth region image shown in FIG. 4D is fused intothe to-be-processed facial image shown in FIG. 4A, the mouth size is inharmony with the face size, which may be implemented by using a facialimage three-dimensional model obtained in advance by using facial imagesof a plurality of sample users. Optionally, a target region may be firstdetermined in the facial image three-dimensional model, and then, theto-be-processed facial image of the target object and the targetexpression-material image are respectively mapped to thethree-dimensional model, thereby obtaining the first region image andthe second region image, and ensuring that the first region image andthe second region image can be aligned and matched.

In the present disclosure, scaling processing (e.g., a scalingoperation) may also be performed on the second region image, therebymaking the processed second region image in overall harmony with theto-be-processed facial image, to avoid an inharmonious situation such asthe second region image shown in FIG. 4E being excessively small, whichcauses the obtained entire synthesized image to be unnatural.

As another embodiment of the present disclosure, in after the targetexpression-material image is obtained through screening, and before thesecond region image is extracted, scaling processing is performed on theentire target expression-material image, thereby making the processedtarget expression-material image be aligned with the to-be-processedfacial image, and ensuring that the extracted second region imagesynthesized into the to-be-processed facial image to be harmonious.

The method for obtaining the first region image and the second regionimage is not limited to the implementation manner of the foregoingdescription, and may be further determined by using manners such ascoordinate positioning, which is not described in detail herein in thepresent disclosure.

S608. The processor synthesizes the second region image into theto-be-processed facial image through a Poisson fusion manner, to obtaina target facial image of the target object.

Optionally, in combination with the explanation for the Poisson fusionmanner in the foregoing embodiment, step S608 may include: calculating apixel gradient of the region image by using a pixel in the region imageand a corresponding neighboring pixel; synthesizing the second regionimage into the to-be-processed facial image by using a Poissonalgorithm, and calculating a pixel gradient of the obtained synthesizedimage; using the synthesized image as the target facial image of thetarget object in a case of determining that the pixel gradient of thesynthesized image is equal to the pixel gradient of the second regionimage; and adjusting the pixel in the second region image in a case ofdetermining that the pixel gradient of the synthesized image is notequal to the pixel gradient of the second region image, until the pixelgradient of the synthesized image is equal to the pixel gradient of thesecond region image, thereby ensuring that the obtained target facialimage to be harmonious.

S609. The processor sends the obtained target facial image to a display.

Optionally, the processor may further send the obtained target facialimage to a memory for storage, or to a network side, to implementsharing of the synthesized image. The present disclosure does not limitany implementation method.

S610. The display displays the target facial image.

In one embodiment, according to the synthesized image displayed by thedisplay, as shown in FIG. 4F, whether the synthesized image is the imageneeded by the user may be determined, and if not, image synthesis may befurther performed according to the foregoing manner, to obtain thesynthesized image required by the user.

Accordingly, in one embodiment, screening for the targetexpression-material image is implemented in combination with the skincolor information of the region that needs to be replaced in theto-be-processed facial image, and the skin color information of otherregions, to greatly improve the goodness of fit of the to-be-processedfacial image and the region image of the target synthesis region in thetarget expression-material image, ensure the entire skin color of thesynthesized image to be harmonious and natural, and ensure the facialorgan positioning. Expression details in the region image are remained,thereby making the obtained synthesized image more vivid, and improvingthe synthesis efficiency of the facial expression image.

Based on the foregoing description of the facial expression synthesissolution provided in the present disclosure, in operation, such as in asocial platform, to increase the fun, by using the foregoing imagesynthesis method, expression exchange may be performed on two selectedfacial images, or a region image of a selected facial image may be usedto replace the corresponding region image in another facial image,thereby obtaining the result of facial expression change, such aschanging an angry object to a happy object.

Optionally, in combination with the schematic flowchart of the facialexpression synthesis method shown in FIG. 8, when the user intends toreplace the mouth expression of object A (as shown in FIG. 9A or FIG.9D), an image of object B for implementing image synthesis may beselected according to the foregoing manner and in combination with skincolor information of object A and the mouth region. For example, for theto-be-processed facial image shown in FIG. 9A, the targetexpression-material image shown in FIG. 9B is screened out; and for theto-be-processed facial image shown in FIG. 9D, the targetexpression-material image shown in FIG. 9E is screened out. Then,through extraction and preprocessing of the region image, the mouthregion of object B may be fused into the image of object A incombination with the Poisson fusion algorithm, thereby making object Ahave the mouth expression of object B. As the synthesized image shown inFIG. 9C, the smiling mouth in FIG. 9A is replaced with the laughingmouth in FIG. 9B; and as the synthesized image shown in FIG. 9F, thegrinning mouth in FIG. 9D is replaced with the mouth with the tonguesticking out in FIG. 9E.

Therefore, in the present disclosure, various expressions of the targetobject can be obtained by using the foregoing manner, and the fun forthe user to use the facial expression is increased.

In the present disclosure, the foregoing target synthesis region is notlimited to the mouth region, and may be further an eye region, a noseregion, and the like. The implementation methods are similar and are notdescribed in detail herein again in the present disclosure.

FIG. 10 is a structural block diagram of a facial expression synthesisapparatus according to an embodiment of the present disclosure. Theapparatus is applied to or integrated in an electronic device. Theelectronic device may be a terminal device or a server. That is, theapparatus provided in the present disclosure may be applied to aterminal side or a network side. The composite structures are the sameand are not separately described again in the present disclosure. In oneembodiment, the apparatus may include: an image obtaining module 101, animage processing module 102, an image screening module 103, an imageextraction module 104, and an image fusion module 105.

The image obtaining module 101 is configured to obtain a to-be-processedfacial image of a target object.

Optionally, the image obtaining module 101 may obtain theto-be-processed facial image by using an image acquisition device, ormay obtain, through a communications interface, to-be-processed facialimages transmitted by other devices, which is not limited in the presentdisclosure.

The image processing module 102 is configured to process theto-be-processed facial image by using a face-recognition operation, toobtain skin color information of the to-be-processed facial image.

Optionally, referring to FIG. 11, the image processing module 102 mayinclude: a first facial feature point recognition unit 1021, configuredto recognize first facial feature points of the to-be-processed facialimage; a first region image determining unit 1022, configured todetermine a first region image of a target synthesis region in theto-be-processed facial image by using the first facial feature points;and a first skin color detection unit 1023, configured to perform skincolor detection on the first region image, to obtain first skin colorinformation.

For the extraction of the facial feature points and the skin colordetection method of the image, reference may be made to the descriptionin the corresponding parts in the foregoing embodiments. Details are notdescribed herein.

In addition, as shown in FIG. 11, the image processing module 102 mayfurther include: a second skin color detection unit 1024, configured toperform skin color detection on other region images of theto-be-processed facial image, to obtain second skin color information.

For different composition structures of the image processing module 102,screening standards set to screen out the target expression-materialimages may be different.

The image screening module 103 is configured to screen out a targetexpression-material image that is in an expression-material imagelibrary and that matches the skin color information.

In the present disclosure, if the image processing module 102 onlyobtains the first skin color information or the second skin colorinformation, the image screening module 103 may be configured to screenout a target expression-material image matching the first skin colorinformation or the second skin color information. If the imageprocessing module 102 obtains the first skin color information and thesecond skin color information, the image screening module 103 may beconfigured to screen out a target expression-material image matching thefirst skin color information and the second skin color information.

For different screening manners, manners for storing expression-materialimages in the expression-material image library may be different. Forthe content, reference may be made to the description of thecorresponding parts of the foregoing method embodiments.

The image extraction module 104 is configured to extract a region imagecorresponding to a target synthesis region in the targetexpression-material image.

Optionally, as shown in FIG. 12, the image extraction module 104 mayinclude: a second facial feature point recognition unit 1041, configuredto recognize second facial feature points of the targetexpression-material image; and a second region image determining unit1042, configured to determine a second region image corresponding to thetarget synthesis region in the target expression-material image by usingthe second facial feature points.

The image fusion module 105 is configured to perform Poisson fusionprocessing on the region image and the to-be-processed facial image, toobtain a target facial image of the target object.

Optionally, as shown in FIG. 13, the image fusion module 105 mayinclude: a pixel gradient calculation unit 1051, configured to calculatea pixel gradient of the region image by using a pixel in the regionimage and a corresponding neighboring pixel; an image synthesis unit1052, configured to synthesize the region image into the to-be-processedfacial image by using a Poisson algorithm, and calculate a pixelgradient of the obtained synthesized image; a target facial imagedetermining unit 1053, configured to use the synthesized image as thetarget facial image of the target object in a case of determining thatthe pixel gradient of the synthesized image is equal to the pixelgradient of the region image; and a region image adjusting unit 1054,configured to adjust the pixel in the region image in a case ofdetermining that the pixel gradient of the synthesized image is notequal to the pixel gradient of the region image, until the pixelgradient of the synthesized image is equal to the pixel gradient of theregion image.

As another embodiment of the present disclosure, on the basis of theforegoing embodiments, the apparatus may further include: an imageadjusting module, configured to perform scaling processing on the targetexpression-material image according to the to-be-processed facial image,so that the processed target expression-material image is aligned withthe to-be-processed facial image.

Before the image fusion processing, the adjusting method for the regionimage is not limited to the manner of the image adjusting module, andreference may be made to the description of the corresponding parts inthe foregoing method embodiments. Details are not described herein againin one embodiment.

Accordingly, in the present disclosure, when an expression image of aregion of a to-be-processed facial image of a target object needs to bemodified, a target expression-material image matching the skin color maybe selected according to skin color information of the region and skincolor information of other regions, thereby ensuring that after a regionimage of a target synthesis region obtained from the targetexpression-material image is synthesized into the to-be-processed facialimage, the entire skin color of the synthesized image is harmonious, andexpression details in the region image are remained, thereby making thesynthesized image more vivid. Moreover, because the target synthesisregion is positioned based on facial feature points in the presentdisclosure, the positioning precision of to-be-replaced organs isensured, and the synthesis efficiency of the facial expression image isimproved.

The foregoing provides description mainly from the functional modules ofthe facial expression synthesis apparatus, and the following describesthe hardware structure of the electronic device from the perspective ofthe hardware composite structure.

Referring to the diagram of the hardware structure of the electronicdevice shown in FIG. 1, the electronic device may include: acommunications interface 11, a memory 12, and a processor 13.

The communications interface 11 may be used for implementingcommunication with other devices, or reading an expression-materialimage stored in the local memory 12.

The memory 12 is configured to store a plurality of instructions forimplementing the foregoing facial expression synthesis method.

The processor 13 is configured to load and execute the plurality ofinstructions stored in the memory 12, including: obtaining ato-be-processed facial image of a target object, and processing theto-be-processed facial image by using a face-recognition operation, toobtain skin color information of the to-be-processed facial image;screening out a target expression-material image that is in anexpression-material image library and that matches the skin colorinformation; extracting a region image corresponding to a targetsynthesis region in the target expression-material image; and performingPoisson fusion processing on the region image and the to-be-processedfacial image, to obtain a target facial image of the target object.

An embodiment of the present disclosure further provides a storagemedium. Optionally, in one embodiment, the storage medium stores acomputer program. The computer program, when run, is configured toperform a data loading method.

Optionally, in one embodiment, the storage medium may be located in atleast one of a plurality of network devices in the network shown in theforegoing embodiments.

Optionally, in one embodiment, the storage medium is configured to storeprogram code for performing the following steps:

S1. Obtain a to-be-processed facial image of a target object, andprocess the to-be-processed facial image by using a face-recognitionoperation, to obtain skin color information of the to-be-processedfacial image.

S2. Screen out a target expression-material image that is in anexpression-material image library and that matches the skin colorinformation.

S3. Extract a region image corresponding to a target synthesis region inthe target expression-material image.

S4. Perform Poisson fusion processing on the region image and theto-be-processed facial image, to obtain a target facial image of thetarget object.

Optionally, the storage medium is further configured to store programcode used for performing the following steps: recognizing first facialfeature points of the to-be-processed facial image; determining a firstregion image of a target synthesis region in the to-be-processed facialimage by using the first facial feature points; and performing skincolor detection on the first region image, to obtain first skin colorinformation.

Optionally, the storage medium is further configured to store programcode used for performing the following steps: screening out a targetexpression-material that is in the expression-material image library andthat matches the first skin color information.

Optionally, the storage medium is further configured to store programcode used for performing the following steps: performing skin colordetection on other region images of the to-be-processed facial image, toobtain second skin color information; and the screening out a targetexpression-material image that is in an expression-material imagelibrary and that matches the skin color information includes: screeningout a target expression-material that is in the expression-materialimage library and that matches the first skin color information and thesecond skin color information.

Optionally, the storage medium is further configured to store programcode used for performing the following steps: recognizing second facialfeature points of the target expression-material image; and determininga second region image corresponding to the target synthesis region inthe target expression-material image by using the second facial featurepoints.

Optionally, the storage medium is further configured to store programcode used for performing the following steps: before the extracting aregion image corresponding to a target synthesis region in the targetexpression-material image, performing scaling processing on the targetexpression-material image according to the to-be-processed facial image,so that the processed target expression-material image is aligned withthe to-be-processed facial image.

Optionally, the storage medium is further configured to store programcode used for performing the following steps: obtaining a polygonalshape corresponding to facial feature points of the target synthesisregion in the target expression-material image, where endpoints of thepolygonal shape are the facial feature points of the target synthesisregion; and extracting an image corresponding to the polygonal shape, asa region image used for synthesizing with a to-be-processed facialexpression.

Optionally, the storage medium is further configured to store programcode used for performing the following steps: calculating a pixelgradient of the region image by using a pixel in the region image and acorresponding neighboring pixel; synthesizing the region image into theto-be-processed facial image by using a Poisson algorithm, andcalculating a pixel gradient of the obtained synthesized image; usingthe synthesized image as the target facial image of the target object ina case of determining that the pixel gradient of the synthesized imageis equal to the pixel gradient of the region image; and adjusting thepixel in the region image in a case of determining that the pixelgradient of the synthesized image is not equal to the pixel gradient ofthe region image, until the pixel gradient of the synthesized image isequal to the pixel gradient of the region image.

Optionally, for specific examples in one embodiment, reference may bemade to the examples described in the foregoing embodiments. Details arenot described herein again in one embodiment.

Optionally, in one embodiment, the storage medium may include, but isnot limited to: any medium that can store program code, such as a USBflash drive, a read-only memory (ROM), a random access memory (RAM), aremovable hard disk, a magnetic disk, or an optical disc.

The embodiments in this specification are all described in a progressivemanner. Description of each of the embodiments focuses on differencesfrom other embodiments, and reference may be made to each other for thesame or similar parts among respective embodiments. The apparatus andthe electronic device disclosed in the embodiments correspond to themethod disclosed in the embodiments and therefore are only brieflydescribed, and reference may be made to the method parts for theassociated part.

A person skilled in the art may further realize that, in combinationwith the embodiments herein, units and algorithm, steps of each exampledescribed can be implemented with electronic hardware, computersoftware, or the combination thereof. In order to clearly describe theinterchangeability between the hardware and the software, compositionsand steps of each example have been generally described according tofunctions in the foregoing descriptions. Whether the functions areexecuted in a mode of hardware or software depends on particularapplications and design constraint conditions of the technicalsolutions. Persons skilled in the art can use different methods toimplement the described functions for each particular application, butit is not to be considered that the implementation goes beyond the scopeof the embodiments of the present disclosure.

In combination with the embodiments herein, steps of the method oralgorithm described may be directly implemented using hardware, asoftware module executed by a processor, or the combination thereof. Thesoftware module may be placed in a RAM, an internal memory, a ROM, anelectrically programmable ROM (EPROM), an electrically erasableprogrammable ROM (EEPROM), a register, a hard disk, a removable magneticdisk, a CD-ROM, or any storage medium of other forms well-known in theart.

The above descriptions of the disclosed embodiments make a personskilled in the art implement or use the present disclosure. Variousmodifications to these embodiments are obvious to a person skilled inthe art, and the general principles defined in this specification may beimplemented in other embodiments without departing from the core conceptand scope of the present disclosure. Therefore, the present disclosureis not limited to these embodiments illustrated in the presentdisclosure, but needs to conform to the broadest scope consistent withthe principles and novel features disclosed in the present disclosure.

What is claimed is:
 1. A facial expression synthesis method comprising:obtaining a to-be-processed facial image of a target object, andprocessing the to-be-processed facial image by using a face-recognitionoperation, to obtain skin color information of the to-be-processedfacial image; screening out a target expression-material image, from aplurality of expression-material images in an expression-material imagelibrary, matching the skin color information; extracting a region imagecorresponding to a target synthesis region in the targetexpression-material image; and performing Poisson fusion processing onthe region image and the to-be-processed facial image to fuse the regionimage with the to-be-processed facial image, so as to obtain a targetfacial image of the target object.
 2. The method according to claim 1,wherein the processing the to-be-processed facial image by using aface-recognition operation, to obtain skin color information of theto-be-processed facial image comprises: recognizing first facial featurepoints of the to-be-processed facial image; determining a first regionimage of a target synthesis region in the to-be-processed facial imageby using the first facial feature points; and performing skin colordetection on the first region image, to obtain first skin colorinformation.
 3. The method according to claim 2, wherein the screeningout a target expression-material image, from a plurality ofexpression-material images in an expression-material image library,matching the skin color information comprises: screening out anexpression-material image that is in the expression-material imagelibrary and that matches the first skin color information as the targetexpression-material image.
 4. The method according to claim 2, whereinthe method further comprises: performing skin color detection on otherregion images of the to-be-processed facial image, to obtain second skincolor information; and screening out a target expression-material image,from a plurality of expression-material images in an expression-materialimage library, matching the skin color information comprises: screeningout an expression-material image that is in the expression-materialimage library and that matches the first skin color information and thesecond skin color information as the target expression-material image.5. The method according to claim 2, wherein the extracting a regionimage corresponding to a target synthesis region in the targetexpression-material image comprises: recognizing second facial featurepoints of the target expression-material image; and determining a secondregion image corresponding to the target synthesis region in the targetexpression-material image by using the second facial feature points. 6.The method according to claim 5, wherein before the extracting a regionimage corresponding to a target synthesis region in the targetexpression-material image, the method further comprises: performingscaling processing on the target expression-material image according tothe to-be-processed facial image, so that the processed targetexpression-material image is aligned with the to-be-processed facialimage.
 7. The method according to claim 1, wherein the extracting aregion image corresponding to a target synthesis region in the targetexpression-material image comprises: obtaining a polygonal shapecorresponding to facial feature points of the target synthesis region inthe target expression-material image, wherein endpoints of the polygonalshape are the facial feature points of the target synthesis region; andextracting an image corresponding to the polygonal shape, as a regionimage used for synthesizing with a to-be-processed facial expression. 8.The method according to claim 1, wherein the performing Poisson fusionprocessing on the region image and the to-be-processed facial image tofuse the region image with the to-be-processed facial image, so as toobtain a target facial image of the target object comprises: calculatinga pixel gradient of the region image by using a pixel in the regionimage and a corresponding neighboring pixel; synthesizing the regionimage into the to-be-processed facial image by using a Poissonalgorithm, and calculating a pixel gradient of the obtained synthesizedimage; using the synthesized image as the target facial image of thetarget object in a case of determining that the pixel gradient of thesynthesized image is equal to the pixel gradient of the region image;and adjusting the pixel in the region image in a case of determiningthat the pixel gradient of the synthesized image is not equal to thepixel gradient of the region image, until the pixel gradient of thesynthesized image is equal to the pixel gradient of the region image. 9.An electronic device, comprising: a communications interface; a memoryfor storing a plurality of instructions; and a processor configured toload and execute the plurality of instructions to perform: obtaining ato-be-processed facial image of a target object, and processing theto-be-processed facial image by using a face-recognition operation, toobtain skin color information of the to-be-processed facial image;screening out a target expression-material image, from a plurality ofexpression-material images in an expression-material image library,matching the skin color information; extracting a region imagecorresponding to a target synthesis region in the targetexpression-material image; and performing Poisson fusion processing onthe region image and the to-be-processed facial image to fuse the regionimage with the to-be-processed facial image, so as to obtain a targetfacial image of the target object.
 10. The electronic device accordingto claim 9, wherein the processing the to-be-processed facial image byusing a face-recognition operation, to obtain skin color information ofthe to-be-processed facial image comprises: recognizing first facialfeature points of the to-be-processed facial image; determining a firstregion image of a target synthesis region in the to-be-processed facialimage by using the first facial feature points; and performing skincolor detection on the first region image, to obtain first skin colorinformation.
 11. The electronic device according to claim 10, whereinthe screening out a target expression-material image, from a pluralityof expression-material images in an expression-material image library,matching the skin color information comprises: screening out anexpression-material image that is in the expression-material imagelibrary and that matches the first skin color information as the targetexpression-material image.
 12. The electronic device according to claim10, wherein the method further comprises: performing skin colordetection on other region images of the to-be-processed facial image, toobtain second skin color information; and screening out a targetexpression-material image, from a plurality of expression-materialimages in an expression-material image library, matching the skin colorinformation comprises: screening out an expression-material image thatis in the expression-material image library and that matches the firstskin color information and the second skin color information as thetarget expression-material image.
 13. The electronic device according toclaim 10, wherein the extracting a region image corresponding to atarget synthesis region in the target expression-material imagecomprises: recognizing second facial feature points of the targetexpression-material image; and determining a second region imagecorresponding to the target synthesis region in the targetexpression-material image by using the second facial feature points. 14.The electronic device according to claim 13, wherein before theextracting a region image corresponding to a target synthesis region inthe target expression-material image, the processor further performs:performing scaling processing on the target expression-material imageaccording to the to-be-processed facial image, so that the processedtarget expression-material image is aligned with the to-be-processedfacial image.
 15. The electronic device according to claim 9, whereinthe extracting a region image corresponding to a target synthesis regionin the target expression-material image comprises: obtaining a polygonalshape corresponding to facial feature points of the target synthesisregion in the target expression-material image, wherein endpoints of thepolygonal shape are the facial feature points of the target synthesisregion; and extracting an image corresponding to the polygonal shape, asa region image used for synthesizing with a to-be-processed facialexpression.
 16. The electronic device according to claim 9, wherein theperforming Poisson fusion processing on the region image and theto-be-processed facial image to fuse the region image with theto-be-processed facial image, so as to obtain a target facial image ofthe target object comprises: calculating a pixel gradient of the regionimage by using a pixel in the region image and a correspondingneighboring pixel; synthesizing the region image into theto-be-processed facial image by using a Poisson algorithm, andcalculating a pixel gradient of the obtained synthesized image; usingthe synthesized image as the target facial image of the target object ina case of determining that the pixel gradient of the synthesized imageis equal to the pixel gradient of the region image; and adjusting thepixel in the region image in a case of determining that the pixelgradient of the synthesized image is not equal to the pixel gradient ofthe region image, until the pixel gradient of the synthesized image isequal to the pixel gradient of the region image.
 17. A non-transitorycomputer-readable storage medium storing computer program instructionsexecutable by at least one processor to perform: obtaining ato-be-processed facial image of a target object, and processing theto-be-processed facial image by using a face-recognition operation, toobtain skin color information of the to-be-processed facial image;screening out a target expression-material image, from a plurality ofexpression-material images in an expression-material image library,matching the skin color information; extracting a region imagecorresponding to a target synthesis region in the targetexpression-material image; and performing Poisson fusion processing onthe region image and the to-be-processed facial image to fuse the regionimage with the to-be-processed facial image, so as to obtain a targetfacial image of the target object.
 18. The non-transitorycomputer-readable storage medium according to claim 17, wherein theprocessing the to-be-processed facial image by using a face-recognitionoperation, to obtain skin color information of the to-be-processedfacial image comprises: recognizing first facial feature points of theto-be-processed facial image; determining a first region image of atarget synthesis region in the to-be-processed facial image by using thefirst facial feature points; and performing skin color detection on thefirst region image, to obtain first skin color information.
 19. Thenon-transitory computer-readable storage medium according to claim 18,wherein the screening out a target expression-material image, from aplurality of expression-material images in an expression-material imagelibrary, matching the skin color information comprises: screening out anexpression-material image that is in the expression-material imagelibrary and that matches the first skin color information as the targetexpression-material image.
 20. The non-transitory computer-readablestorage medium according to claim 18, wherein the computer programinstructions are executable by at least one processor to furtherperform: performing skin color detection on other region images of theto-be-processed facial image, to obtain second skin color information;and screening out a target expression-material image, from a pluralityof expression-material images in an expression-material image library,matching the skin color information comprises: screening out anexpression-material image that is in the expression-material imagelibrary and that matches the first skin color information and the secondskin color information as the target expression-material image.